package com.zhkj.txg.module.mine.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhkj.lib.config.BASE_URL
import com.zhkj.lib.utils.SpanUtil
import com.zhkj.txg.R
import com.zhkj.txg.base.CustomApplication
import com.zhkj.txg.module.home.entity.RecommendInfo
import com.zhkj.txg.module.mine.entity.CollectionEntity
import com.zhkj.txg.utils.ImageUtils

class CollectionAdapter : BaseQuickAdapter<CollectionEntity, BaseViewHolder>(R.layout.item_collection_good), LoadMoreModule {

    init {
        setOnItemClickListener { adapter, view, position ->

        }
    }

    override fun convert(helper: BaseViewHolder, item: CollectionEntity) {
        val imageView = helper.setText(R.id.tvCollectionName, item.goods?.goodsName)
            .setText(R.id.tvCollectionPrice, SpanUtil.setMoneySymbol(item.goods?.price.toString(), false))
            .getView<ImageView>(R.id.ivCollectionImage)
        ImageUtils.loadImage(context, imageView, item.goods?.image ?: "")
    }
}